<div class="content">
    <div id="example_title">
        <h1>Simple Tabs</h1>
        Below is an example of how to use tabs.
    </div>
    <div id="example_view"></div>
    <div id="example_code"></div>
</div>

<!--CODE-->
<div id="tabs" style="width: 100%;"></div>
<div id="selected-tab" style="padding: 10px 0px">tab1</div>

<!--CODE-->
<script type="module">
import { w2tabs, query } from '__W2UI_PATH__'

new w2tabs({
    box: '#tabs',
    name: 'tabs',
    active: 'tab1',
    tabs: [
        { id: 'tab1', text: 'Tab 1' },
        { id: 'tab2', text: 'Tab 2' },
        { id: 'tab3', text: 'Tab 3' },
        { id: 'tab4', text: 'Tab 4' }
    ],
    onClick(event) {
        query('#selected-tab').html(event.target);
    }
})
</script>
